﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MomoCMS.Areas.Admin.Controllers
{
    public class ToolsController : Controller
    {
        //
        // GET: /Admin/Tools/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult FixDatabase()
        {
            return View();
        }

        [HttpPost]
        public ActionResult FixDatabase(int? index)
        {
            return View();
        }

        public ActionResult UpLoad()
        {
            return View();
        }

        [HttpPost]
        public ActionResult UpLoad(int? i) {
            HttpPostedFileBase file = Request.Files["file1"];
            //存入文件
            if (file.ContentLength > 0) {
                file.SaveAs(Server.MapPath("~/uploadfiles/") + System.IO.Path.GetFileName(file.FileName));
            }
            ViewBag.FileName = System.IO.Path.GetFileName(file.FileName);
            return View();
        }

        
    }
}
